#include <iostream>
#include <vector>

using namespace std;

int main() {
    uint64_t r = 0;
    for (uint64_t i = 1; i < 1000; ++i) {
        uint64_t t = 1;
        for (uint64_t j = 0; j < i; ++j) {
            t = (t * i) % 10'000'000'000;
        }
        r = (r + t) % 10'000'000'000;
    }
    cout << r << endl;
}